package com.itheima.tlias84.controller;

import com.itheima.tlias84.Util.ResultUtil;
import com.itheima.tlias84.mapper.DeptMapper;
import com.itheima.tlias84.mapper.EmpMapper;
import com.itheima.tlias84.mapper.LogMapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@AllArgsConstructor
public class TestAutowiredController {
    EmpMapper empMapper;
    DeptMapper deptMapper;
    LogMapper logMapper;

//    public TestAutowiredController(EmpMapper empMapper, DeptMapper deptMapper, LogMapper logMapper) {
//        this.empMapper = empMapper;
//        this.deptMapper = deptMapper;
//        this.logMapper = logMapper;
//
//    }

//    @Autowired
//    public void setDeptMapper(DeptMapper deptMapper){
//        this.deptMapper = deptMapper;
//    }

    @GetMapping("testCons")
    public ResultUtil query() {
        log.info("empMapper={}", empMapper);
        log.info("deptMapper={}", deptMapper);
        log.info("logMapper={}", logMapper);
        return ResultUtil.success();
    }
}
